<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../0js/vue.js"></script>
</head>
<body>

<div id="root">
    姓：<input type="text" v-model:value="firstName"> <br>
    名：<input type="text" v-model="lastName"> <br>
    全名 <span>{{fullName()}}</span>
</div>

<script type="text/javascript">
    // 阻止vue在启动时生成生产提示
    Vue.config.productionTip = false

    const vm = new Vue({
        el:"#root",
        data: { // 数据发生变化，模板重新解析，用到的修改，不用到的保持不变
            firstName: "张",
            lastName:"三"
        },
        methods: {
            fullName() {
                return this.firstName + "-" + this.lastName
            }
        }
    });

</script>
</body>
</html>